package my.algorithms.mcorrea.graphs;

import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author mcorrea
 */
public class Node {
		
		public enum Color  {WHITE, GREY, BLACK};
	
		private int value;
		private Set<Integer> edges;
		public Color color;
		
		
		public Node(int value, Set<Integer> edges){
			this.value = value;
			this.edges = edges;
		}
		
		public Node(int value){
			this.value = value;
			this.edges = new HashSet<Integer>();
		}
		
		public void addEdges(int... edges){
			for(int e: edges){
				this.edges.add(e);
			}
		}

		public Set<Integer> getEdges() {
			return edges;
		}

		public void setEdges(Set<Integer> edges) {
			this.edges = edges;
		}

		public int getValue() {
			return value;
		}

		public void setValue(int value) {
			this.value = value;
		}

		public Color getColor() {
			return color;
		}

		public void setColor(Color color) {
			this.color = color;
		}

		
		
		
		
		@Override
		public String toString(){
			StringBuilder sb = new StringBuilder();
			for(Integer e: edges){
				sb.append(e);
				sb.append(" ");
			}
			return this.value +" --> "+sb.toString();
		}
		
		
}
